package com.sky.Screen;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;

import com.healthcare.widget.ActionBar;
import com.healthcare.widget.ActionBar.IntentAction;
import com.sky.heathcare.R;


import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.Button;

public class ErrorNetworkActivity extends Activity {

		
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.error_network_activity);
		
		Button offBtn = (Button)findViewById(R.id.off_btn);
		
		offBtn.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				gotoMainScreen();
			}
		});
		Button tryBtn = (Button)findViewById(R.id.try_btn);
		
		tryBtn.setOnClickListener(new View.OnClickListener() {
			public void onClick(View v) {
				gotoLoginScreen();
			}
		});
	}

	
	private void gotoLoginScreen() {
		Intent intent = new Intent(this, loginActivity.class);
		intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
		startActivity(intent);
		overridePendingTransition(R.anim.slide_on_from_right, R.anim.slide_away_to_left);
		finish();
	}

	private void gotoMainScreen() {
		Intent intent = new Intent(this, MainActivity.class);
		intent.putExtra("USER_STATUS", false);
		intent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
		startActivity(intent);
		overridePendingTransition(R.anim.slide_on_from_right, R.anim.slide_away_to_left);
		finish();
	}
}
